#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "FileLayout.h"
#include "ToolDockWidget.h"
#include "MdiDockWidget.h"
#include "BrowserDockWidget.h"
#include "MessageDockWidget.h"
#include <iostream>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setWindowState(Qt::WindowMaximized);
    //this->add_tool_layout();
    this->takeCentralWidget();
    if(ui->centralwidget)
    {
        delete ui->centralwidget;
    }
    this->add_layout();
    this->setDockNestingEnabled(true);
}

MainWindow::~MainWindow()
{
    delete ui;
}



void
MainWindow::add_tool_layout ()
{
    //
}



void
MainWindow::add_layout()
{

    QDockWidget* mdi = new MdiDockWidget ;
    this->addDockWidget(Qt::DockWidgetArea::RightDockWidgetArea,mdi);

    QDockWidget* browser = new BrowserDockWidget ;
    this->addDockWidget(Qt::DockWidgetArea::LeftDockWidgetArea,browser);

    QDockWidget* message = new MessageDockWidget ;
    this->addDockWidget(Qt::DockWidgetArea::BottomDockWidgetArea,message);

    QDockWidget* tool = new ToolDockWidget ;
    this->addDockWidget(Qt::DockWidgetArea::TopDockWidgetArea,tool);

}
